//
//  ELLocationManager.swift
//  WZApp
//
//  Created by evol on 2018/8/1.
//  Copyright © 2018年 evol. All rights reserved.
//

import UIKit
import RxSwift

class ELLocationManager{

    static let instance = ELLocationManager()
    
    let disposeBag = DisposeBag()
    
    var locationDatas:[ELLocationModel]?
    
    open class var share: ELLocationManager {
        return instance
    }
    
    init() {
        let version = UserDefaults.standard.integer(forKey: USERDEFAULT_LOCATION_VERSION)
        ELAppService.loadLocationDatas(version).subscribe(onNext:{[weak self] result in
            self?.locationDatas = result
        }).disposed(by: disposeBag)
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
